﻿
namespace SdmxMl.Common
{

    /// <summary>
    /// TextType provides for a set of language-specific alternates to be provided 
    /// for any human-readable construct in the instance.
    /// </summary>
    public class TextType
    {
        #region Constructors

        public TextType()
        {
        }

        public TextType(string lg, string text)
        {
            Text = text;
            foreach (string l in LangSupport.SupportedLanguages)
            {
                if (l == lg)
                {
                    Language = l;
                    break;
                }
            }
        }

        public TextType(TextType clone)
        {
            Language = clone.Language;
            Text = clone.Text;
        }

        #endregion

        #region Properties

        public string Language { get; set; }

        public string Text { get; set; }

        #endregion

        #region String Representation

        public override string ToString()
        {
            return Text;
        }

        #endregion
    }
}
